<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div class="app"></div>

</body>
<script>
    Vue.createApp({
        data() {
            return {
                content: "",
                menu: "真空套餐,帝王套餐,夏日套餐,学生套餐",
                isShowMenu: false
            }
        },
        methods: {
            welcomBtnClick() {
                this.content = "欢迎您的光临,贵宾一位~"
            },
            byeBtncClick() {
                this.content = "欢迎下次光临,真空套餐下次八折~"
            },
            isShowClick() {
                this.isShowMenu = !this.isShowMenu
            },
        },
        template: `
        <div>
            <div>{{content}}</div>
            <button v-on:click="welcomBtnClick">有顾客来</button>&nbsp;
            <button v-on:click="byeBtncClick">顾客离开</button>
        </div>
        <div>
            <div v-if="isShowMenu">{{menu}}</div>
            <button v-on:click="isShowClick">显示/隐藏菜单</button>
        </div>
        `
    }).mount(".app")
</script>

</html>